<template>
	<div class="myself">
		<div class="header">
	    <div class="contents">
	      <img :src="headerImg" class="headerImg"/>
	      <h3 class="userName">{{userName}}</h3>
	     </div>
	   </div>
	   <customerinformation></customerinformation>
	   <root :sort="sort"></root>
	</div>
</template>

<script>
import customerinformation from '@/views/MemberCenter/customerinformation'
import root from '@/components/m-footer/root'
	export default {
		name:'myself',
		components:{
			customerinformation,
			root,
		},
		data () {
			return {
				headerImg:'',
				userName:'',
				sort:1
			}
		},
		created () {
			 window.document.title = this.$route.meta.title;
			 this.login()
		},
		mounted () {

		},
		methods:{
			//登录
		login() {
			this.$http.get(this.$store.state.reqUrl + '/test/login', {
				params:{
				   isMember:'0'
				}
			}).then(res => {
			    console.log(res)
				this.getCustomerInfo();
				console.log(document.cookie)
			})
			/*this.$http.get(this.$store.state.reqUrl + '/test/login?openId=oid4101XcDhlcB7D5amPlAvOs4ik',{
				}).then(res => {
					console.log(res)
			    })*/
		},
		//获取客户信息
		 getCustomerInfo() {
		   	this.$http.get(this.$store.state.reqUrl + '/user/info',{}).then(res => {
			if(res.status == 200) {
				 this.headerImg = res.data.headSculptureUrl;
				 this.userName = res.data.userName;
			  }
		    })
		  }
		}
	}
</script>

<style lang="less" scoped>
  .myself{
  	   width:100%;
  		.header {
  		width: 100%;
  		height: 200px;
  		background: #00EEEE;
  		position: relative;
  		.contents{
  		position: absolute;
  		top:32px;
  		width:100%;
  		.headerImg{
  			width:100px;
  			height:100px;
  			margin:0 auto;
  		}
  		.userName{
  			width:100%;
  			color: #FFFFFF;
  			font-size: 34px;
  			text-align: center;
  		}
      }
  	}
  }
</style>
